# -*- coding:utf-8 -*-
# abs()
# abs() 函数可以完成对数字求绝对值计算
# def add_num(a, b):
#     return abs(a) + abs(b)
#
#
# result = add_num(-1, 2)
# print(result)


# map(function, iterable)
# 将传⼊的函数变量function作⽤到iterable变量的每个元素中，并将结果组成新的列表

# function -- 函数
# iterable -- 序列

# list1 = [1, 2, 3, 4, 5]
#
#
# def func(x):
#     return x ** 2
#
#
# result = map(func, list1)
# print(result)
# print(list(result))


# list2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
#
#
# def func(x):
#     return x % 2 == 0
#
#
# result = map(func, list2)
# print(result)
# print(list(result))

